package com.example.red_tea_house.moudle.Home.adapter;

import android.content.Context;
import android.content.Intent;

import androidx.annotation.NonNull;
import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentManager;
import androidx.lifecycle.Lifecycle;
import androidx.viewpager2.adapter.FragmentStateAdapter;

import com.example.red_tea_house.MyApplication;
import com.example.red_tea_house.util.ToastUtil;

import java.util.ArrayList;
import java.util.List;

public class HomeFragmentPagersAdapter extends FragmentStateAdapter {
    List<Fragment> fragmentList ;
    public HomeFragmentPagersAdapter(@NonNull FragmentManager fragmentManager,
                                     @NonNull Lifecycle lifecycle, List<Fragment> fragments) {
        super(fragmentManager, lifecycle);
        fragmentList = fragments;
    }

    @NonNull
    @Override
    public Fragment createFragment(int position) {
        return fragmentList.get(position);
    }

    @Override
    public int getItemCount() {
        return fragmentList.size();
    }
}
